<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jquery中使用mock</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/Mock.js/1.0.0/mock-min.js"></script>
<style>
    #app{
        height: 200px;
        width: 200px;
        background-color: aqua;
    }
</style>

</head>

<body>
<div id="app">

<ul>
    <li><a href="#">hello</a></li>
</ul>

</div>
</body>
<script>MOCK='true'</script>
<script src="./mock/index.js"></script>
<script>
    $.ajax({
        url: '/user/userinfo',
        dataType: 'json',
        success: (data) => {
            console.log(data)
        $('#app').append(data)
        }

    })

</script>

</html>